<div class="modal hide fade in" id="detalhe<?=$i;?>" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">

        <div class="modal-header">
            <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
            <span id="myModalLabel"><strong> <?php echo $linha['log_id']; ?>º - Detalhe da Logistica de Apoio</span>
        </div>

        <div class="modal-body">

            <p>

                <ul id="myTab" class="nav nav-tabs">
                    <li class="active">
                        <a data-toggle="tab" href="#home<?=$i;?>"><?= $t_deta ?></a>
                    </li>
                    <li>
                        <a data-toggle="tab" href="#acoes<?=$i;?>"><?= $t_acoes ?></a>
                    </li>
                </ul>

                <div id="myTabContent" class="tab-content">
                    <div id="home<?=$i;?>" class="tab-pane fade active in">
                        <p>
                            <label>Solicitante: <?php echo "{$linha['cli_code']} - {$linha['pos_nome']} {$linha['cli_nome']}"; ?></label>
                            <label><?= $t_pais?>: <?php echo $linha['pai_nome'];?></label>
                            <label><?= $t_aeronaves ?>: <?php echo $linha['aer_nome'];?></label>
                            <label><?= $t_quantidade?>: <?php echo $linha['log_qtd'];?></label>
                            <label>Service Local Time: <?php echo todatabr($linha['log_dataabast']).$linha['log_hora']?></label>
                            <label>Appron Place: <?php echo $linha['log_local'];?></label>
                            <label>Time of Dep: <?php echo $linha['time_dept'];?></label>
                        </p>
                    </div>
                    
                    <div id="acoes<?=$i;?>" class="tab-pane fade">

                        <p>
                            
                            <div id="accordion2" class="accordion">
        
                                <?php
                                $sql_acao = "SELECT * FROM logisticaacao 
                                INNER JOIN logistica ON logistica.log_id=logisticaacao.log_id
                                LEFT JOIN cliente ON cliente.cli_id=logisticaacao.cli_id
                                LEFT JOIN posto ON posto.pos_id=cliente.pos_id
                                LEFT JOIN logisticastatus ON logisticastatus.log_sta_id=logisticaacao.log_sta_id
                                WHERE logisticaacao.log_id='{$linha['log_id']}' ORDER BY logisticaacao.aca_data DESC, logisticaacao.aca_hora DESC";
                                $res_acao = sql($sql_acao);
                                $x=0;
                                while($linha_acao = mysql_fetch_array($res_acao)){
                                ?>
                                <div id="accordion2" class="accordion">
                                    <?php if ($x == 0){ ?>
                                    <div class="accordion-group">
                                      <div class="accordion-heading">
                                        <a href="#<?php echo $linha_acao['aca_id'];?>" data-parent="#accordion2" data-toggle="collapse" class="accordion-toggle">
                                          <?php echo "<span style='color:#{$linha_acao['log_sta_cor']}'>{$linha_acao['log_sta_nome']}</span> - ".todatabr($linha['aca_data'])." {$linha['aca_hora']}h"; ?>
                                        </a>
                                      </div>
                                      <div class="accordion-body collapse in" id="<?php echo $linha_acao['aca_id'];?>">
                                        <div class="accordion-inner">
                                          <?php 
                                          echo "<p>{$linha_acao['aca_msg']}</p>"; 
                                          echo "<p>{$t_solucionador}: {$linha_acao['cli_code']} {$linha_acao['pos_nome']}{$linha_acao['cli_nome']}</p>";
                                          ?>
                                        </div>
                                      </div>
                                    </div>
                                    <?php } else { ?>
                                    <div class="accordion-group">
                                      <div class="accordion-heading">
                                        <a href="#<?php echo $linha_acao['aca_id'];?>" data-parent="#accordion2" data-toggle="collapse" class="accordion-toggle">
                                          <?php echo "<span style='color:#{$linha_acao['log_sta_cor']}'>{$linha_acao['log_sta_nome']}</span> - ".todatabr($linha['aca_data'])." {$linha['aca_hora']}h"; ?>
                                        </a>
                                      </div>
                                      <div class="accordion-body collapse" id="<?php echo $linha_acao['aca_id'];?>">
                                        <div class="accordion-inner">
                                          <?php 
                                          echo "<p>{$linha_acao['aca_msg']}</p>"; 
                                          echo "<p>{$t_solucionador}: {$linha_acao['cli_code']} {$linha_acao['pos_nome']}{$linha_acao['cli_nome']}</p>";
                                          ?>
                                        </div>
                                      </div>
                                    </div>
                                    <?php } ?>
                                  </div>
                                <?php $x++; } ?>
                            
                            </div>
                        
                        </p>

                    </div>
                </div>

            </p>

        </div>

        <div class="modal-footer">

            <button class="btn" data-dismiss="modal" aria-hidden="true"><?= $t_fech ?></button>
            <button class="btn" onclick="window.open('mod/detalhe/logisticaabastecimentoimprimir.php?log_id=<?=$linha['log_id'];?>');"><?= $t_impri ?></button>

        </div>
        
    </form>
    
</div>